package com.clive.xxweb.bean;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.util.Date;

public class Dish {
    private Integer id;
    @NotNull(message = "菜品名称不能为空")
    private String dishName;
    @Min(message = "菜品价格不能小于5",value = 5)
    @Max(message = "菜品价格不能大于500",value = 500)
    private Double price;
    @NotNull(message = "菜品图片不能为空")
    private String picPath;
    private Integer buyCount;
    private Date created;
    private Date updated;
    private Integer status;
    private DishCategory category;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getDishName() {
        return dishName;
    }

    public void setDishName(String dishName) {
        this.dishName = dishName;
    }

    public Double getPrice() {
        return price;
    }

    public void setPrice(Double price) {
        this.price = price;
    }

    public String getPicPath() {
        return picPath;
    }

    public void setPicPath(String picPath) {
        this.picPath = picPath;
    }

    public Integer getBuyCount() {
        return buyCount;
    }

    public void setBuyCount(Integer buyCount) {
        this.buyCount = buyCount;
    }

    public Date getCreated() {
        return created;
    }

    public void setCreated(Date created) {
        this.created = created;
    }

    public Date getUpdated() {
        return updated;
    }

    public void setUpdated(Date updated) {
        this.updated = updated;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public DishCategory getCategory() {
        return category;
    }

    public void setCategory(DishCategory category) {
        this.category = category;
    }

    public Dish(Integer id, String dishName, Double price, String picPath, Integer buyCount, Date created, Date updated, Integer status) {
        this.id = id;
        this.dishName = dishName;
        this.price = price;
        this.picPath = picPath;
        this.buyCount = buyCount;
        this.created = created;
        this.updated = updated;
        this.status = status;
            }

    public Dish() {

    }

    @Override
    public String toString() {
        return "Dish{" +
                "id=" + id +
                ", dishName='" + dishName + '\'' +
                ", price=" + price +
                ", picPath='" + picPath + '\'' +
                ", buyCount=" + buyCount +
                ", created=" + created +
                ", updated=" + updated +
                ", status=" + status +
                '}';
    }
}
